<html>
<head><meta charset="utf-8"><title>consteval in chalk · t-compiler/rust-analyzer · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/index.html">t-compiler/rust-analyzer</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/consteval.20in.20chalk.html">consteval in chalk</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="219586724"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/consteval%20in%20chalk/near/219586724" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/consteval.20in.20chalk.html#219586724">(Dec 11 2020 at 10:29)</a>:</h4>
<p><span class="user-mention" data-user-id="129457">@Florian Diebold</span> btw, what's the state of const params/const eval in chalk?</p>



<a name="219586765"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/consteval%20in%20chalk/near/219586765" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/consteval.20in.20chalk.html#219586765">(Dec 11 2020 at 10:30)</a>:</h4>
<p>IntelliJ can do basic const generics</p>



<a name="219586776"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/consteval%20in%20chalk/near/219586776" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/consteval.20in.20chalk.html#219586776">(Dec 11 2020 at 10:30)</a>:</h4>
<p>I wonder if we should too?</p>



<a name="219586941"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/consteval%20in%20chalk/near/219586941" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Florian Diebold <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/consteval.20in.20chalk.html#219586941">(Dec 11 2020 at 10:32)</a>:</h4>
<p>Chalk models const parameters, but it doesn't do const eval, it punts that to the <a href="https://github.com/rust-analyzer/rust-analyzer/blob/41321d96789ed918eebda02ada76758765d19d16/crates/hir_ty/src/traits/chalk/interner.rs#L229"><code>Interner</code></a></p>



<a name="219587038"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/consteval%20in%20chalk/near/219587038" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Florian Diebold <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/consteval.20in.20chalk.html#219587038">(Dec 11 2020 at 10:33)</a>:</h4>
<p>i.e. it's basically agnostic about consts, they can be anything as long as the interner can compare them</p>



<a name="219587183"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/consteval%20in%20chalk/near/219587183" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Florian Diebold <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/consteval.20in.20chalk.html#219587183">(Dec 11 2020 at 10:34)</a>:</h4>
<p>so, we would have to implement that ourselves (I guess integrating MIRI would not be a viable option right now)</p>



<a name="219587234"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/consteval%20in%20chalk/near/219587234" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Florian Diebold <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/consteval.20in.20chalk.html#219587234">(Dec 11 2020 at 10:35)</a>:</h4>
<p>would be a fun project though <span aria-label="big smile" class="emoji emoji-1f604" role="img" title="big smile">:big_smile:</span></p>



<a name="219587574"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/consteval%20in%20chalk/near/219587574" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Florian Diebold <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/consteval.20in.20chalk.html#219587574">(Dec 11 2020 at 10:38)</a>:</h4>
<p>we should at least do basic numbers to get arrays working 100%</p>



<a name="219588217"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/consteval%20in%20chalk/near/219588217" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Laurențiu <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/consteval.20in.20chalk.html#219588217">(Dec 11 2020 at 10:42)</a>:</h4>
<p><span class="user-mention silent" data-user-id="129457">Florian Diebold</span> <a href="#narrow/stream/185405-t-compiler.2Fwg-rls-2.2E0/topic/consteval.20in.20chalk/near/219587183">said</a>:</p>
<blockquote>
<p>so, we would have to implement that ourselves (I guess integrating MIRI would not be a viable option right now)</p>
</blockquote>
<p>Welp, so what will we do in the long run?</p>



<a name="219588302"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/consteval%20in%20chalk/near/219588302" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Florian Diebold <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/consteval.20in.20chalk.html#219588302">(Dec 11 2020 at 10:43)</a>:</h4>
<p>meld with rustc and use MIRI, I guess</p>



<a name="219588397"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/consteval%20in%20chalk/near/219588397" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/consteval.20in.20chalk.html#219588397">(Dec 11 2020 at 10:44)</a>:</h4>
<p>Yeah, that</p>



<a name="219588406"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/consteval%20in%20chalk/near/219588406" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/consteval.20in.20chalk.html#219588406">(Dec 11 2020 at 10:44)</a>:</h4>
<p>which has "implement MIR" as a subgoal</p>



<a name="219588495"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/consteval%20in%20chalk/near/219588495" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/consteval.20in.20chalk.html#219588495">(Dec 11 2020 at 10:44)</a>:</h4>
<p>At which piont we'd actually be able to do codegen</p>



<a name="219606533"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/consteval%20in%20chalk/near/219606533" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/consteval.20in.20chalk.html#219606533">(Dec 11 2020 at 13:38)</a>:</h4>
<p>RA as a JIT? <span aria-label="eyes" class="emoji emoji-1f440" role="img" title="eyes">:eyes:</span></p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>